
<%--
  Created by IntelliJ IDEA.
  User: qiliping
  Date: 16/4/9
  Time: 下午7:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="paging" uri="paging-taglib" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>状态变更</title>
    <script>
        $(function(){
            $(".changestatus").click(function(){
               var productid = ${product.productId};
                var sta = $(this).attr("status");
                var obj = $(this);
                $.ajax({
                   url:"${ctx}/product/change_status_submit",
                    type:"POST",
                    dataType:"json",
                    data:{id:productid,status:sta},
                    success:function(res){
                        if(res==1) {
                            $(obj).parent().html("");
                        }else{
                            alert("系统错误");
                        }
                    }
                });
            });
            //

        })
    </script>
</head>
<body>
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title">
            基金管理
            <small>基金列表</small>
        </h3>
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="${ctx}/main">
                    首页
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="${ctx}/product">
                    基金管理
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">
                    基金状态变更
                </a>
            </li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>

<div class="main">

    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-primary">

                <div class="panel-body height410">
                    <div class="form-group">
                        <label class="control-label">基金名称：</label>
                        <span>${product.productName}</span>
                    </div>
                    <div class="form-group">
                        <label class="control-label">基金管理人：</label>
                        <span>${product.fundCompanyName }</span>
                    </div>
                    <div class="form-group">
                        <label class="control-label">基金经理 ：</label>
                        <span>${product.fundManagerName}</span>
                    </div>
                    <div class="form-group">
                        <label class="control-label">托管银行：</label>
                        <span>${product.fundCustodianName}</span>
                    </div>
                    <div class="form-group">
                        <label class="control-label">券商：</label>
                        <span>${product.fundTradingBroker}</span>
                    </div>
                    <div class="form-group">
                        <label class="control-label pull-left">总规模：</label>
                        <span style="margin-left: 75px;display: block;" class="trunk-fill4">
                            <fmt:formatNumber value="${product.productTotalScale}" pattern=",000"></fmt:formatNumber>万元
                        </span>
                    </div>
                    <div class="form-group">
                        <label class="control-label pull-left">成立时间：</label>
                        <span >
                            <fmt:formatDate value="${product.registerDate}" pattern="yyyy-MM-dd"/>

                        </span>
                    </div>
                    <div class="form-group">
                        <label class="control-label pull-left">已募集：</label>
                        <span >
                            <fmt:formatNumber value="${product.hasInvestAmount}" pattern=",000"></fmt:formatNumber>万元

                        </span>
                    </div>
                    <div class="form-group">
                        <label class="control-label pull-left">状态：</label>
                        <span >
                            <c:choose>
                                <c:when test="${product.productStatus == 3}">
                                    预约中
                                </c:when>
                                <c:when test="${product.productStatus == 4}">
                                    募集中
                                </c:when>
                                <c:when test="${product.productStatus == 8}">
                                    运行中
                                </c:when>
                                <c:when test="${product.productStatus == 9}">
                                    已结束
                                </c:when>
                            </c:choose>

                        </span>
                    </div>
                </div>
            </div>



            <div class="form-group">


                    <div class="col-md-9 col-md-offset-3">
                        <c:if test="${product.productStatus == 3}">
                            <button type="submit" class="btn blue changestatus" status="4">变更为募集中</button>
                        </c:if>
                        <c:if test="${product.productStatus == 4}">
                            <button type="submit" class="btn blue changestatus" status="8">变更为运行中</button>
                        </c:if>
                        <c:if test="${product.productStatus == 8}">
                            <button type="submit" class="btn blue changestatus" status="9">变更为结束</button>
                        </c:if>
                    </div>

            </div>



        </div>
    </div>

</div>

</body>
</html>
